#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time    : 2021/8/20 19:57
# @Author  : 李中华
# @Email   : 1260429766@qq.com
# @File    : writeConfig.py

from configparser import ConfigParser
from ProgramPath import programPath
import os

conf = ConfigParser()
configFilePath = os.path.join(programPath , 'config' ,'config.ini')

class WriteConfig:
    def __init__(self):
        conf.read(configFilePath,encoding='gbk')

    def setConfig(self,section,option,value):
        conf.set(section,option,value)
        conf.write(open(configFilePath,'w'))

if __name__ == '__main__':
    WriteConfig().setConfig('admin登录入口','cookies','aaa')
